package com.gui.config;

import com.gui.interceptor.RegisterInterceptor;
import com.gui.interceptor.SessionInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * SpringMVCConfig
 *
 * @author guigu
 * @QQ 1170258867
 * @date 2020/5/30
 * @description
 */
@Configuration
public class WebAPPConfig implements WebMvcConfigurer{

    @Autowired
    private SessionInterceptor sessionInterceptor;

    @Autowired
    private RegisterInterceptor registerInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(sessionInterceptor).addPathPatterns("/**");
        registry.addInterceptor(registerInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/main","/","/static/**","/callback","/page/**","/question/**");
    }


    
}
